/*
SQLyog Ultimate v9.62 
MySQL - 5.5.21 : Database - unicorns
*********************************************************************
*/

/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`unicorns` /*!40100 DEFAULT CHARACTER SET utf8 */;

USE `unicorns`;

/*Table structure for table `castle` */

DROP TABLE IF EXISTS `castle`;

CREATE TABLE `castle` (
  `Name` varchar(50) NOT NULL,
  `Location_City` varchar(50) NOT NULL,
  `Location_Kingdom` varchar(50) NOT NULL,
  `Location_ImaginaryWorld_Name` varchar(50) NOT NULL,
  `Location_ImaginaryWorld_Creator` varchar(50) NOT NULL,
  PRIMARY KEY (`Name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `castle` */

insert  into `castle`(`Name`,`Location_City`,`Location_Kingdom`,`Location_ImaginaryWorld_Name`,`Location_ImaginaryWorld_Creator`) values ('The EF Castle','Redmond','Rainier','Magic Unicorn World','ADO.NET');

/*Table structure for table `ladyinwaiting` */

DROP TABLE IF EXISTS `ladyinwaiting`;

CREATE TABLE `ladyinwaiting` (
  `PrincessId` int(11) NOT NULL,
  `CastleName` varchar(50) NOT NULL,
  `FirstName` varchar(50) NOT NULL,
  `Title` varchar(50) NOT NULL,
  PRIMARY KEY (`PrincessId`,`CastleName`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `ladyinwaiting` */

insert  into `ladyinwaiting`(`PrincessId`,`CastleName`,`FirstName`,`Title`) values (19,'The EF Castle','Lettice','Countess'),(20,'The EF Castle','Ulrika','Lady'),(21,'The EF Castle','Yolande','Duchess');

/*Table structure for table `princess` */

DROP TABLE IF EXISTS `princess`;

CREATE TABLE `princess` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(50) NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;

/*Data for the table `princess` */

insert  into `princess`(`Id`,`Name`) values (19,'Cinderella'),(20,'Sleeping Beauty'),(21,'Snow White');

/*Table structure for table `unicorn` */

DROP TABLE IF EXISTS `unicorn`;

CREATE TABLE `unicorn` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(50) NOT NULL,
  `Version` varchar(50) DEFAULT NULL,
  `PrincessId` int(11) NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;

/*Data for the table `unicorn` */

insert  into `unicorn`(`Id`,`Name`,`Version`,`PrincessId`) values (5,'Binky',NULL,19),(6,'Silly',NULL,19),(7,'Beepy',NULL,20),(8,'Creepy',NULL,21);

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
